import torch
import torchvision
from torch import nn

vgg16_true = torchvision.models.vgg16()

print(vgg16_true)

# 末尾添加
# vgg16_true.add_module("linear_1",nn.Linear(4096,10))
# print(vgg16_true)

# 模块内部添加
# vgg16_true.classifier.add_module("linear_1",nn.Linear(4096,10))
# print(vgg16_true)

# 修改
vgg16_true.classifier[6] = nn.Linear(4096, 10)
print(vgg16_true)
